/*
               File: PrcUser
        Description: Prc User
             Author: GeneXus C# Generator version 10_2_5-78484
       Generated on: 6/6/2014 9:52:41.91
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using System.Data;
using System.Data.SqlClient;
using GeneXus.Data;
using com.genexus;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.WebControls;
using GeneXus.Http;
using GeneXus.Procedure;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Threading;
using System.Xml.Serialization;
using System.Data.SqlTypes;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace GeneXus.Programs {
   public class prcuser : GXProcedure
   {
      public prcuser( )
      {
         context = new GxContext(  );
         DataStoreUtil.LoadDataStores( context);
         dsDefault = context.GetDataStore("Default");
         IsMain = true;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public prcuser( IGxContext context )
      {
         this.context = context;
         IsMain = false;
         dsDefault = context.GetDataStore("Default");
      }

      public void release( )
      {
      }

      public void execute( String aP0_UserBairro ,
                           String aP1_UserCel ,
                           String aP2_UserCep ,
                           int aP3_UserCID ,
                           String aP4_UserCidade ,
                           long aP5_UserCPF ,
                           DateTime aP6_UserElevacao ,
                           String aP7_UserEmail ,
                           String aP8_UserEndereco ,
                           String aP9_UserEnderecoComplemento ,
                           int aP10_UserEnderecoNumero ,
                           String aP11_UserEstado ,
                           String aP12_UserFoto ,
                           DateTime aP13_UserIniciacao ,
                           DateTime aP14_UserNascimento ,
                           String aP15_UserNivel ,
                           String aP16_UserNome ,
                           String aP17_UserPergunta ,
                           String aP18_UserResposta ,
                           String aP19_UserRG ,
                           String aP20_UserSenha ,
                           String aP21_UserTel ,
                           long aP22_UserId )
      {
         this.AV19UserBairro = aP0_UserBairro;
         this.AV15UserCel = aP1_UserCel;
         this.AV20UserCep = aP2_UserCep;
         this.AV8UserCID = aP3_UserCID;
         this.AV21UserCidade = aP4_UserCidade;
         this.AV13UserCPF = aP5_UserCPF;
         this.AV11UserElevacao = aP6_UserElevacao;
         this.AV23UserEmail = aP7_UserEmail;
         this.AV16UserEndereco = aP8_UserEndereco;
         this.AV18UserEnderecoComplemento = aP9_UserEnderecoComplemento;
         this.AV17UserEnderecoNumero = aP10_UserEnderecoNumero;
         this.AV22UserEstado = aP11_UserEstado;
         this.AV24UserFoto = aP12_UserFoto;
         this.AV10UserIniciacao = aP13_UserIniciacao;
         this.AV25UserNascimento = aP14_UserNascimento;
         this.AV30UserNivel = aP15_UserNivel;
         this.AV9UserNome = aP16_UserNome;
         this.AV28UserPergunta = aP17_UserPergunta;
         this.AV29UserResposta = aP18_UserResposta;
         this.AV12UserRG = aP19_UserRG;
         this.AV26UserSenha = aP20_UserSenha;
         this.AV14UserTel = aP21_UserTel;
         this.AV32UserId = aP22_UserId;
         initialize();
         executePrivate();
      }

      public void executeSubmit( String aP0_UserBairro ,
                                 String aP1_UserCel ,
                                 String aP2_UserCep ,
                                 int aP3_UserCID ,
                                 String aP4_UserCidade ,
                                 long aP5_UserCPF ,
                                 DateTime aP6_UserElevacao ,
                                 String aP7_UserEmail ,
                                 String aP8_UserEndereco ,
                                 String aP9_UserEnderecoComplemento ,
                                 int aP10_UserEnderecoNumero ,
                                 String aP11_UserEstado ,
                                 String aP12_UserFoto ,
                                 DateTime aP13_UserIniciacao ,
                                 DateTime aP14_UserNascimento ,
                                 String aP15_UserNivel ,
                                 String aP16_UserNome ,
                                 String aP17_UserPergunta ,
                                 String aP18_UserResposta ,
                                 String aP19_UserRG ,
                                 String aP20_UserSenha ,
                                 String aP21_UserTel ,
                                 long aP22_UserId )
      {
         prcuser objprcuser;
         objprcuser = new prcuser();
         objprcuser.AV19UserBairro = aP0_UserBairro;
         objprcuser.AV15UserCel = aP1_UserCel;
         objprcuser.AV20UserCep = aP2_UserCep;
         objprcuser.AV8UserCID = aP3_UserCID;
         objprcuser.AV21UserCidade = aP4_UserCidade;
         objprcuser.AV13UserCPF = aP5_UserCPF;
         objprcuser.AV11UserElevacao = aP6_UserElevacao;
         objprcuser.AV23UserEmail = aP7_UserEmail;
         objprcuser.AV16UserEndereco = aP8_UserEndereco;
         objprcuser.AV18UserEnderecoComplemento = aP9_UserEnderecoComplemento;
         objprcuser.AV17UserEnderecoNumero = aP10_UserEnderecoNumero;
         objprcuser.AV22UserEstado = aP11_UserEstado;
         objprcuser.AV24UserFoto = aP12_UserFoto;
         objprcuser.AV10UserIniciacao = aP13_UserIniciacao;
         objprcuser.AV25UserNascimento = aP14_UserNascimento;
         objprcuser.AV30UserNivel = aP15_UserNivel;
         objprcuser.AV9UserNome = aP16_UserNome;
         objprcuser.AV28UserPergunta = aP17_UserPergunta;
         objprcuser.AV29UserResposta = aP18_UserResposta;
         objprcuser.AV12UserRG = aP19_UserRG;
         objprcuser.AV26UserSenha = aP20_UserSenha;
         objprcuser.AV14UserTel = aP21_UserTel;
         objprcuser.AV32UserId = aP22_UserId;
         objprcuser.context.SetSubmitInitialConfig(context);
         objprcuser.initialize();
         ThreadPool.QueueUserWorkItem( new WaitCallback( executePrivateCatch ),objprcuser);
      }

      void executePrivateCatch( object stateInfo )
      {
         try
         {
            ((prcuser)stateInfo).executePrivate();
         }
         catch ( Exception e )
         {
            GXUtil.SaveToEventLog( "Design", e);
            throw e ;
         }
      }

      void executePrivate( )
      {
         /* GeneXus formulas */
         /* Output device settings */
         AV36GXLvl1 = 0;
         /* Using cursor P00042 */
         pr_default.execute(0, new Object[] {AV32UserId});
         while ( (pr_default.getStatus(0) != 101) )
         {
            A43UserId = P00042_A43UserId[0];
            A40000UserFoto_GXI = P00042_A40000UserFoto_GXI[0];
            A1UserCID = P00042_A1UserCID[0];
            A12UserBairro = P00042_A12UserBairro[0];
            A8UserCel = P00042_A8UserCel[0];
            A41UserCep = P00042_A41UserCep[0];
            A13UserCidade = P00042_A13UserCidade[0];
            A6UserCPF = P00042_A6UserCPF[0];
            A4UserElevacao = P00042_A4UserElevacao[0];
            A14UserEmail = P00042_A14UserEmail[0];
            A9UserEndereco = P00042_A9UserEndereco[0];
            A11UserEnderecoComplemento = P00042_A11UserEnderecoComplemento[0];
            A10UserEnderecoNumero = P00042_A10UserEnderecoNumero[0];
            A42UserEstado = P00042_A42UserEstado[0];
            A3UserIniciacao = P00042_A3UserIniciacao[0];
            A16UserNascimento = P00042_A16UserNascimento[0];
            A21UserNivel = P00042_A21UserNivel[0];
            A2UserNome = P00042_A2UserNome[0];
            A19UserPergunta = P00042_A19UserPergunta[0];
            A20UserResposta = P00042_A20UserResposta[0];
            A59UserRespostaKey = P00042_A59UserRespostaKey[0];
            A5UserRG = P00042_A5UserRG[0];
            A17UserSenha = P00042_A17UserSenha[0];
            A18UserSenhaKey = P00042_A18UserSenhaKey[0];
            A7UserTel = P00042_A7UserTel[0];
            A15UserFoto = P00042_A15UserFoto[0];
            AV36GXLvl1 = 1;
            A1UserCID = AV8UserCID;
            A12UserBairro = AV19UserBairro;
            A8UserCel = AV15UserCel;
            A41UserCep = AV20UserCep;
            A13UserCidade = AV21UserCidade;
            A6UserCPF = AV13UserCPF;
            A4UserElevacao = AV11UserElevacao;
            A14UserEmail = AV23UserEmail;
            A9UserEndereco = AV16UserEndereco;
            A11UserEnderecoComplemento = AV18UserEnderecoComplemento;
            A10UserEnderecoNumero = AV17UserEnderecoNumero;
            A42UserEstado = AV22UserEstado;
            A15UserFoto = AV24UserFoto;
            A40000UserFoto_GXI = AV37Userfoto_GXI;
            A3UserIniciacao = AV10UserIniciacao;
            A16UserNascimento = AV25UserNascimento;
            A21UserNivel = AV30UserNivel;
            A2UserNome = AV9UserNome;
            A19UserPergunta = AV28UserPergunta;
            AV33UserRespostaKey = Crypto.GetEncryptionKey( );
            A20UserResposta = Crypto.Encrypt64( AV29UserResposta, AV33UserRespostaKey);
            A59UserRespostaKey = AV33UserRespostaKey;
            A5UserRG = AV12UserRG;
            AV27UserSenhaKey = Crypto.GetEncryptionKey( );
            A17UserSenha = Crypto.Encrypt64( AV26UserSenha, AV27UserSenhaKey);
            A18UserSenhaKey = AV27UserSenhaKey;
            A7UserTel = AV14UserTel;
            /* Using cursor P00043 */
            pr_default.execute(1, new Object[] {A1UserCID, A12UserBairro, A8UserCel, A41UserCep, A13UserCidade, A6UserCPF, A4UserElevacao, A14UserEmail, A9UserEndereco, A11UserEnderecoComplemento, A10UserEnderecoNumero, A42UserEstado, A15UserFoto, A3UserIniciacao, A16UserNascimento, A21UserNivel, A2UserNome, A19UserPergunta, A20UserResposta, A59UserRespostaKey, A5UserRG, A17UserSenha, A18UserSenhaKey, A7UserTel, A40000UserFoto_GXI, A43UserId});
            pr_default.close(1);
            dsDefault.SmartCacheProvider.SetUpdated("TBLUser") ;
            /* Exiting from a For First loop. */
            if (true) break;
         }
         pr_default.close(0);
         if ( AV36GXLvl1 == 0 )
         {
            /*
               INSERT RECORD ON TABLE TBLUser

            */
            A1UserCID = AV8UserCID;
            A12UserBairro = AV19UserBairro;
            A8UserCel = AV15UserCel;
            A41UserCep = AV20UserCep;
            A13UserCidade = AV21UserCidade;
            A6UserCPF = AV13UserCPF;
            A4UserElevacao = AV11UserElevacao;
            A14UserEmail = AV23UserEmail;
            A9UserEndereco = AV16UserEndereco;
            A11UserEnderecoComplemento = AV18UserEnderecoComplemento;
            A10UserEnderecoNumero = AV17UserEnderecoNumero;
            A42UserEstado = AV22UserEstado;
            A15UserFoto = AV24UserFoto;
            A40000UserFoto_GXI = AV37Userfoto_GXI;
            A3UserIniciacao = AV10UserIniciacao;
            A16UserNascimento = AV25UserNascimento;
            A21UserNivel = AV30UserNivel;
            A2UserNome = AV9UserNome;
            A19UserPergunta = AV28UserPergunta;
            AV33UserRespostaKey = Crypto.GetEncryptionKey( );
            A20UserResposta = Crypto.Encrypt64( AV29UserResposta, AV33UserRespostaKey);
            A59UserRespostaKey = AV33UserRespostaKey;
            A5UserRG = AV12UserRG;
            AV27UserSenhaKey = Crypto.GetEncryptionKey( );
            A17UserSenha = Crypto.Encrypt64( AV26UserSenha, AV27UserSenhaKey);
            A18UserSenhaKey = AV27UserSenhaKey;
            A7UserTel = AV14UserTel;
            /* Using cursor P00044 */
            pr_default.execute(2, new Object[] {A1UserCID, A2UserNome, A3UserIniciacao, A4UserElevacao, A5UserRG, A6UserCPF, A7UserTel, A8UserCel, A9UserEndereco, A10UserEnderecoNumero, A11UserEnderecoComplemento, A12UserBairro, A41UserCep, A13UserCidade, A42UserEstado, A14UserEmail, A15UserFoto, A40000UserFoto_GXI, A16UserNascimento, A17UserSenha, A18UserSenhaKey, A19UserPergunta, A20UserResposta, A21UserNivel, A59UserRespostaKey});
            pr_default.close(2);
            /* Retrieving last key number assigned */
            /* Using cursor P00045 */
            pr_default.execute(3);
            A43UserId = P00045_A43UserId[0];
            pr_default.close(3);
            dsDefault.SmartCacheProvider.SetUpdated("TBLUser") ;
            if ( (pr_default.getStatus(2) == 1) )
            {
               context.Gx_err = 1;
               Gx_emsg = (String)(context.GetMessage( "GXM_noupdate", ""));
            }
            else
            {
               context.Gx_err = 0;
               Gx_emsg = "";
            }
            /* End Insert */
         }
         this.cleanup();
      }

      public void cleanup( )
      {
         context.CommitDataStores("PrcUser");
         CloseOpenCursors();
         if ( IsMain )
         {
            context.CloseConnections() ;
         }
         exitApplication();
      }

      protected void CloseOpenCursors( )
      {
      }

      public override void initialize( )
      {
         scmdbuf = "";
         P00042_A43UserId = new long[1] ;
         P00042_A40000UserFoto_GXI = new String[] {""} ;
         P00042_A1UserCID = new int[1] ;
         P00042_A12UserBairro = new String[] {""} ;
         P00042_A8UserCel = new String[] {""} ;
         P00042_A41UserCep = new String[] {""} ;
         P00042_A13UserCidade = new String[] {""} ;
         P00042_A6UserCPF = new long[1] ;
         P00042_A4UserElevacao = new DateTime[] {DateTime.MinValue} ;
         P00042_A14UserEmail = new String[] {""} ;
         P00042_A9UserEndereco = new String[] {""} ;
         P00042_A11UserEnderecoComplemento = new String[] {""} ;
         P00042_A10UserEnderecoNumero = new int[1] ;
         P00042_A42UserEstado = new String[] {""} ;
         P00042_A3UserIniciacao = new DateTime[] {DateTime.MinValue} ;
         P00042_A16UserNascimento = new DateTime[] {DateTime.MinValue} ;
         P00042_A21UserNivel = new String[] {""} ;
         P00042_A2UserNome = new String[] {""} ;
         P00042_A19UserPergunta = new String[] {""} ;
         P00042_A20UserResposta = new String[] {""} ;
         P00042_A59UserRespostaKey = new String[] {""} ;
         P00042_A5UserRG = new String[] {""} ;
         P00042_A17UserSenha = new String[] {""} ;
         P00042_A18UserSenhaKey = new String[] {""} ;
         P00042_A7UserTel = new String[] {""} ;
         P00042_A15UserFoto = new String[] {""} ;
         A40000UserFoto_GXI = "";
         A12UserBairro = "";
         A8UserCel = "";
         A41UserCep = "";
         A13UserCidade = "";
         A4UserElevacao = DateTime.MinValue;
         A14UserEmail = "";
         A9UserEndereco = "";
         A11UserEnderecoComplemento = "";
         A42UserEstado = "";
         A3UserIniciacao = DateTime.MinValue;
         A16UserNascimento = DateTime.MinValue;
         A21UserNivel = "";
         A2UserNome = "";
         A19UserPergunta = "";
         A20UserResposta = "";
         A59UserRespostaKey = "";
         A5UserRG = "";
         A17UserSenha = "";
         A18UserSenhaKey = "";
         A7UserTel = "";
         A15UserFoto = "";
         AV37Userfoto_GXI = "";
         AV33UserRespostaKey = "";
         AV27UserSenhaKey = "";
         P00045_A43UserId = new long[1] ;
         Gx_emsg = "";
         pr_default = new DataStoreProvider(context, new GeneXus.Programs.prcuser__default(),
            new Object[][] {
                new Object[] {
               P00042_A43UserId, P00042_A40000UserFoto_GXI, P00042_A1UserCID, P00042_A12UserBairro, P00042_A8UserCel, P00042_A41UserCep, P00042_A13UserCidade, P00042_A6UserCPF, P00042_A4UserElevacao, P00042_A14UserEmail,
               P00042_A9UserEndereco, P00042_A11UserEnderecoComplemento, P00042_A10UserEnderecoNumero, P00042_A42UserEstado, P00042_A3UserIniciacao, P00042_A16UserNascimento, P00042_A21UserNivel, P00042_A2UserNome, P00042_A19UserPergunta, P00042_A20UserResposta,
               P00042_A59UserRespostaKey, P00042_A5UserRG, P00042_A17UserSenha, P00042_A18UserSenhaKey, P00042_A7UserTel, P00042_A15UserFoto
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               P00045_A43UserId
               }
            }
         );
         /* GeneXus formulas. */
         context.Gx_err = 0;
      }

      private short AV36GXLvl1 ;
      private int AV8UserCID ;
      private int AV17UserEnderecoNumero ;
      private int A1UserCID ;
      private int A10UserEnderecoNumero ;
      private int GX_INS1 ;
      private long AV13UserCPF ;
      private long AV32UserId ;
      private long A43UserId ;
      private long A6UserCPF ;
      private String scmdbuf ;
      private String Gx_emsg ;
      private DateTime AV11UserElevacao ;
      private DateTime AV10UserIniciacao ;
      private DateTime AV25UserNascimento ;
      private DateTime A4UserElevacao ;
      private DateTime A3UserIniciacao ;
      private DateTime A16UserNascimento ;
      private String AV19UserBairro ;
      private String AV15UserCel ;
      private String AV20UserCep ;
      private String AV21UserCidade ;
      private String AV23UserEmail ;
      private String AV16UserEndereco ;
      private String AV18UserEnderecoComplemento ;
      private String AV22UserEstado ;
      private String AV30UserNivel ;
      private String AV9UserNome ;
      private String AV28UserPergunta ;
      private String AV29UserResposta ;
      private String AV12UserRG ;
      private String AV26UserSenha ;
      private String AV14UserTel ;
      private String A40000UserFoto_GXI ;
      private String A12UserBairro ;
      private String A8UserCel ;
      private String A41UserCep ;
      private String A13UserCidade ;
      private String A14UserEmail ;
      private String A9UserEndereco ;
      private String A11UserEnderecoComplemento ;
      private String A42UserEstado ;
      private String A21UserNivel ;
      private String A2UserNome ;
      private String A19UserPergunta ;
      private String A20UserResposta ;
      private String A59UserRespostaKey ;
      private String A5UserRG ;
      private String A17UserSenha ;
      private String A18UserSenhaKey ;
      private String A7UserTel ;
      private String AV37Userfoto_GXI ;
      private String AV33UserRespostaKey ;
      private String AV27UserSenhaKey ;
      private String AV24UserFoto ;
      private String A15UserFoto ;
      private IGxDataStore dsDefault ;
      private IDataStoreProvider pr_default ;
      private long[] P00042_A43UserId ;
      private String[] P00042_A40000UserFoto_GXI ;
      private int[] P00042_A1UserCID ;
      private String[] P00042_A12UserBairro ;
      private String[] P00042_A8UserCel ;
      private String[] P00042_A41UserCep ;
      private String[] P00042_A13UserCidade ;
      private long[] P00042_A6UserCPF ;
      private DateTime[] P00042_A4UserElevacao ;
      private String[] P00042_A14UserEmail ;
      private String[] P00042_A9UserEndereco ;
      private String[] P00042_A11UserEnderecoComplemento ;
      private int[] P00042_A10UserEnderecoNumero ;
      private String[] P00042_A42UserEstado ;
      private DateTime[] P00042_A3UserIniciacao ;
      private DateTime[] P00042_A16UserNascimento ;
      private String[] P00042_A21UserNivel ;
      private String[] P00042_A2UserNome ;
      private String[] P00042_A19UserPergunta ;
      private String[] P00042_A20UserResposta ;
      private String[] P00042_A59UserRespostaKey ;
      private String[] P00042_A5UserRG ;
      private String[] P00042_A17UserSenha ;
      private String[] P00042_A18UserSenhaKey ;
      private String[] P00042_A7UserTel ;
      private String[] P00042_A15UserFoto ;
      private long[] P00045_A43UserId ;
   }

   public class prcuser__default : DataStoreHelperBase, IDataStoreHelper
   {
      public ICursor[] getCursors( )
      {
         cursorDefinitions();
         return new Cursor[] {
          new ForEachCursor(def[0])
         ,new UpdateCursor(def[1])
         ,new UpdateCursor(def[2])
         ,new ForEachCursor(def[3])
       };
    }

    private static CursorDef[] def;
    private void cursorDefinitions( )
    {
       if ( def == null )
       {
          Object[] prmP00042 ;
          prmP00042 = new Object[] {
          new Object[] {"@AV32UserId",SqlDbType.Decimal,15,0}
          } ;
          Object[] prmP00043 ;
          prmP00043 = new Object[] {
          new Object[] {"@UserCID",SqlDbType.Int,6,0} ,
          new Object[] {"@UserBairro",SqlDbType.VarChar,50,0} ,
          new Object[] {"@UserCel",SqlDbType.VarChar,15,0} ,
          new Object[] {"@UserCep",SqlDbType.VarChar,9,0} ,
          new Object[] {"@UserCidade",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserCPF",SqlDbType.Decimal,11,0} ,
          new Object[] {"@UserElevacao",SqlDbType.DateTime,8,0} ,
          new Object[] {"@UserEmail",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserEndereco",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserEnderecoComplemento",SqlDbType.VarChar,20,0} ,
          new Object[] {"@UserEnderecoNumero",SqlDbType.Int,5,0} ,
          new Object[] {"@UserEstado",SqlDbType.VarChar,2,0} ,
          new Object[] {"@UserFoto",SqlDbType.VarBinary,1024,0} ,
          new Object[] {"@UserIniciacao",SqlDbType.DateTime,8,0} ,
          new Object[] {"@UserNascimento",SqlDbType.DateTime,8,0} ,
          new Object[] {"@UserNivel",SqlDbType.VarChar,50,0} ,
          new Object[] {"@UserNome",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserPergunta",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserResposta",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserRespostaKey",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserRG",SqlDbType.VarChar,12,0} ,
          new Object[] {"@UserSenha",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserSenhaKey",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserTel",SqlDbType.VarChar,14,0} ,
          new Object[] {"@UserFoto_GXI",SqlDbType.VarChar,2048,0} ,
          new Object[] {"@UserId",SqlDbType.Decimal,15,0}
          } ;
          Object[] prmP00044 ;
          prmP00044 = new Object[] {
          new Object[] {"@UserCID",SqlDbType.Int,6,0} ,
          new Object[] {"@UserNome",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserIniciacao",SqlDbType.DateTime,8,0} ,
          new Object[] {"@UserElevacao",SqlDbType.DateTime,8,0} ,
          new Object[] {"@UserRG",SqlDbType.VarChar,12,0} ,
          new Object[] {"@UserCPF",SqlDbType.Decimal,11,0} ,
          new Object[] {"@UserTel",SqlDbType.VarChar,14,0} ,
          new Object[] {"@UserCel",SqlDbType.VarChar,15,0} ,
          new Object[] {"@UserEndereco",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserEnderecoNumero",SqlDbType.Int,5,0} ,
          new Object[] {"@UserEnderecoComplemento",SqlDbType.VarChar,20,0} ,
          new Object[] {"@UserBairro",SqlDbType.VarChar,50,0} ,
          new Object[] {"@UserCep",SqlDbType.VarChar,9,0} ,
          new Object[] {"@UserCidade",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserEstado",SqlDbType.VarChar,2,0} ,
          new Object[] {"@UserEmail",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserFoto",SqlDbType.VarBinary,1024,0} ,
          new Object[] {"@UserFoto_GXI",SqlDbType.VarChar,2048,0} ,
          new Object[] {"@UserNascimento",SqlDbType.DateTime,8,0} ,
          new Object[] {"@UserSenha",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserSenhaKey",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserPergunta",SqlDbType.VarChar,200,0} ,
          new Object[] {"@UserResposta",SqlDbType.VarChar,100,0} ,
          new Object[] {"@UserNivel",SqlDbType.VarChar,50,0} ,
          new Object[] {"@UserRespostaKey",SqlDbType.VarChar,200,0}
          } ;
          Object[] prmP00045 ;
          prmP00045 = new Object[] {
          } ;
          def= new CursorDef[] {
              new CursorDef("P00042", "SELECT [UserId], [UserFoto_GXI], [UserCID], [UserBairro], [UserCel], [UserCep], [UserCidade], [UserCPF], [UserElevacao], [UserEmail], [UserEndereco], [UserEnderecoComplemento], [UserEnderecoNumero], [UserEstado], [UserIniciacao], [UserNascimento], [UserNivel], [UserNome], [UserPergunta], [UserResposta], [UserRespostaKey], [UserRG], [UserSenha], [UserSenhaKey], [UserTel], [UserFoto] FROM [TBLUser] WITH (UPDLOCK) WHERE [UserId] = @AV32UserId ORDER BY [UserId] ",true, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmP00042,1,0,true,true )
             ,new CursorDef("P00043", "UPDATE [TBLUser] SET [UserCID]=@UserCID, [UserBairro]=@UserBairro, [UserCel]=@UserCel, [UserCep]=@UserCep, [UserCidade]=@UserCidade, [UserCPF]=@UserCPF, [UserElevacao]=@UserElevacao, [UserEmail]=@UserEmail, [UserEndereco]=@UserEndereco, [UserEnderecoComplemento]=@UserEnderecoComplemento, [UserEnderecoNumero]=@UserEnderecoNumero, [UserEstado]=@UserEstado, [UserFoto]=@UserFoto, [UserIniciacao]=@UserIniciacao, [UserNascimento]=@UserNascimento, [UserNivel]=@UserNivel, [UserNome]=@UserNome, [UserPergunta]=@UserPergunta, [UserResposta]=@UserResposta, [UserRespostaKey]=@UserRespostaKey, [UserRG]=@UserRG, [UserSenha]=@UserSenha, [UserSenhaKey]=@UserSenhaKey, [UserTel]=@UserTel, [UserFoto_GXI]=@UserFoto_GXI  WHERE [UserId] = @UserId", GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK,prmP00043)
             ,new CursorDef("P00044", "INSERT INTO [TBLUser] ([UserCID], [UserNome], [UserIniciacao], [UserElevacao], [UserRG], [UserCPF], [UserTel], [UserCel], [UserEndereco], [UserEnderecoNumero], [UserEnderecoComplemento], [UserBairro], [UserCep], [UserCidade], [UserEstado], [UserEmail], [UserFoto], [UserFoto_GXI], [UserNascimento], [UserSenha], [UserSenhaKey], [UserPergunta], [UserResposta], [UserNivel], [UserRespostaKey]) VALUES (@UserCID, @UserNome, @UserIniciacao, @UserElevacao, @UserRG, @UserCPF, @UserTel, @UserCel, @UserEndereco, @UserEnderecoNumero, @UserEnderecoComplemento, @UserBairro, @UserCep, @UserCidade, @UserEstado, @UserEmail, @UserFoto, @UserFoto_GXI, @UserNascimento, @UserSenha, @UserSenhaKey, @UserPergunta, @UserResposta, @UserNivel, @UserRespostaKey)", GxErrorMask.GX_NOMASK,prmP00044)
             ,new CursorDef("P00045", "SELECT Ident_Current('[TBLUser]') ",false, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmP00045,1,0,true,false )
          };
       }
    }

    public void getResults( int cursor ,
                            IFieldGetter rslt ,
                            Object[] buf )
    {
       switch ( cursor )
       {
             case 0 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getMultimediaUri(2) ;
                ((int[]) buf[2])[0] = rslt.getInt(3) ;
                ((String[]) buf[3])[0] = rslt.getVarchar(4) ;
                ((String[]) buf[4])[0] = rslt.getVarchar(5) ;
                ((String[]) buf[5])[0] = rslt.getVarchar(6) ;
                ((String[]) buf[6])[0] = rslt.getVarchar(7) ;
                ((long[]) buf[7])[0] = rslt.getLong(8) ;
                ((DateTime[]) buf[8])[0] = rslt.getGXDate(9) ;
                ((String[]) buf[9])[0] = rslt.getVarchar(10) ;
                ((String[]) buf[10])[0] = rslt.getVarchar(11) ;
                ((String[]) buf[11])[0] = rslt.getVarchar(12) ;
                ((int[]) buf[12])[0] = rslt.getInt(13) ;
                ((String[]) buf[13])[0] = rslt.getVarchar(14) ;
                ((DateTime[]) buf[14])[0] = rslt.getGXDate(15) ;
                ((DateTime[]) buf[15])[0] = rslt.getGXDate(16) ;
                ((String[]) buf[16])[0] = rslt.getVarchar(17) ;
                ((String[]) buf[17])[0] = rslt.getVarchar(18) ;
                ((String[]) buf[18])[0] = rslt.getVarchar(19) ;
                ((String[]) buf[19])[0] = rslt.getVarchar(20) ;
                ((String[]) buf[20])[0] = rslt.getVarchar(21) ;
                ((String[]) buf[21])[0] = rslt.getVarchar(22) ;
                ((String[]) buf[22])[0] = rslt.getVarchar(23) ;
                ((String[]) buf[23])[0] = rslt.getVarchar(24) ;
                ((String[]) buf[24])[0] = rslt.getVarchar(25) ;
                ((String[]) buf[25])[0] = rslt.getMultimediaFile(26, rslt.getVarchar(2)) ;
                break;
             case 3 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
       }
    }

    public void setParameters( int cursor ,
                               IFieldSetter stmt ,
                               Object[] parms )
    {
       switch ( cursor )
       {
             case 0 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 1 :
                stmt.SetParameter(1, (int)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (String)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (String)parms[4]);
                stmt.SetParameter(6, (long)parms[5]);
                stmt.SetParameter(7, (DateTime)parms[6]);
                stmt.SetParameter(8, (String)parms[7]);
                stmt.SetParameter(9, (String)parms[8]);
                stmt.SetParameter(10, (String)parms[9]);
                stmt.SetParameter(11, (int)parms[10]);
                stmt.SetParameter(12, (String)parms[11]);
                stmt.SetParameter(13, (String)parms[12]);
                stmt.SetParameter(14, (DateTime)parms[13]);
                stmt.SetParameter(15, (DateTime)parms[14]);
                stmt.SetParameter(16, (String)parms[15]);
                stmt.SetParameter(17, (String)parms[16]);
                stmt.SetParameter(18, (String)parms[17]);
                stmt.SetParameter(19, (String)parms[18]);
                stmt.SetParameter(20, (String)parms[19]);
                stmt.SetParameter(21, (String)parms[20]);
                stmt.SetParameter(22, (String)parms[21]);
                stmt.SetParameter(23, (String)parms[22]);
                stmt.SetParameter(24, (String)parms[23]);
                stmt.SetParameterMultimedia(25, (String)parms[24], (String)parms[12]);
                stmt.SetParameter(26, (long)parms[25]);
                break;
             case 2 :
                stmt.SetParameter(1, (int)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (DateTime)parms[2]);
                stmt.SetParameter(4, (DateTime)parms[3]);
                stmt.SetParameter(5, (String)parms[4]);
                stmt.SetParameter(6, (long)parms[5]);
                stmt.SetParameter(7, (String)parms[6]);
                stmt.SetParameter(8, (String)parms[7]);
                stmt.SetParameter(9, (String)parms[8]);
                stmt.SetParameter(10, (int)parms[9]);
                stmt.SetParameter(11, (String)parms[10]);
                stmt.SetParameter(12, (String)parms[11]);
                stmt.SetParameter(13, (String)parms[12]);
                stmt.SetParameter(14, (String)parms[13]);
                stmt.SetParameter(15, (String)parms[14]);
                stmt.SetParameter(16, (String)parms[15]);
                stmt.SetParameter(17, (String)parms[16]);
                stmt.SetParameterMultimedia(18, (String)parms[17], (String)parms[16]);
                stmt.SetParameter(19, (DateTime)parms[18]);
                stmt.SetParameter(20, (String)parms[19]);
                stmt.SetParameter(21, (String)parms[20]);
                stmt.SetParameter(22, (String)parms[21]);
                stmt.SetParameter(23, (String)parms[22]);
                stmt.SetParameter(24, (String)parms[23]);
                stmt.SetParameter(25, (String)parms[24]);
                break;
       }
    }

 }

}
